class ConvertUserCode{
    //列表中的用户代码字段转用户名称
public void covertUserCodeToName( List  list , String... nameFields ){
        if( list.isEmpty() ){
            return;
        }
        Class< ? > clazz = list.get( 0 ).getClass();
        HashMap<String,Method> getters = new HashMap<>();
        HashMap<String,Method> setters = new HashMap<>();
        Method[] methods = clazz.getMethods();

        for( String field : nameFields ){
            String setterName =  "set" + field.substring(0, 1).toUpperCase() + field.substring(1);
            String getterName = "get" + field.substring(0, 1).toUpperCase() + field.substring(1);
            for( Method method : methods ){
                if( method.getName().equals( setterName )){
                    setters.put( field, method );
                }
                if( method.getName().equals( getterName )){
                    getters.put( field, method );
                }
            }
        }
        Set<String> userNames = new HashSet<>();

        for( Object obj : list ){
            getters.forEach( ( key , method ) -> {
                    try{
                        String name = ( String ) method.invoke( obj );
                        if( StringUtils.isNotEmpty( name ) ){
                            userNames.add( name );
                        }
                    }catch( IllegalAccessException | InvocationTargetException e ){
                            throw new RuntimeException( e );
                    }
            } );
        }
        if( userNames.size()==0)
            return;
        List<SysUser> users = queryByLoginNames( userNames );

        for( Object obj : list ){
            setters.forEach( ( field , method ) -> {
                Method getter = getters.get( field );
                if( getter != null ){
                    try{
                       String userCode = (String) getter.invoke( obj );
                       if( StringUtils.isNotEmpty( userCode ) ){
                           SysUser user = Coll.findUnique( users , u -> u.getLoginName().equals( userCode ) );
                           if( user != null )
                               method.invoke( obj , user.getNickName() );
                       }
                    }catch( IllegalAccessException | InvocationTargetException e ){
                        throw new RuntimeException( e );
                    }
                }
            } );
        }

    }
    private List<SysUser>  queryByLoginNames( List<String> userNames ){ return null ;}

}